function [Tn, cv] = obj_ct_as10(para, profit, ...
    firm_outcome, ind_unilateral_deivation, fc_sim, is_equi_data, N, ....
    g_ar, rand_seed, tau_reps, sig_level, correlated_fc, corr_sim_ct)

[N_firm_outcome, N_mkt, ~] = size(profit);%profit: N_firm_outcome x N_mkt x N 
N_sim = size(fc_sim, 4); % fc_sim: 1 x N_mkt x N x N_sim

% fc
fc_sim = para(1) + para(2)*fc_sim; % 1 x N_mkt x N x N_sim

if correlated_fc
    fc_sim = fc_sim + para(3)*corr_sim_ct;
end

% check eqm
is_equi = true(N_firm_outcome, N_mkt, N_sim);
for s = 1:N_sim        
    for k = 1:N
        totalprofit_k = firm_outcome(:,k) .* (profit(:,:,k) - fc_sim(:,:,k,s)); % N_firm_outcome x N_mkt
        for i = 1:N_firm_outcome % use parfor here instead of in the outer loop to save memory and for consistent comparison with obj_at_as10.m in the time usage
            %method 1
%             is_equi(i,:,s) = is_equi(i,:,s) & (totalprofit_k(i, :) >= totalprofit_k(ind_unilateral_deivation(i,k), :)); % 1 x N_mkt
            %method 2
            ind = totalprofit_k(i, :) < totalprofit_k(ind_unilateral_deivation(i,k), :);
            is_equi(i,ind,s) = false;
        end
    end
end
clear totalprofit_k fc_sim profit firm_outcome ind tmp

% market outcome probabilities
is_equi_unique = (sum(is_equi, 1)==1); % 1 x N_mkt x N_sim
is_equi_mix = sum(is_equi, 1)==0; % 1 x N_mkt x N_sim

% lower bound: an equilibrium is unique
equi_lb = mean(is_equi.*is_equi_unique, 3);% N_firm_outcome x N_mkt 

% upper bound: is an equilibrium
equi_ub = mean(is_equi + is_equi_mix, 3);

% clear some variables
clear is_equi_unique is_equi_mix

% the moment conditions
% m<=0
equi_lb = equi_lb'; % N_mkt x N_firm_outcome
equi_ub = equi_ub';
is_equi_data = is_equi_data'; 
m = [equi_lb(:, 1:end-1) - is_equi_data(:, 1:end-1), is_equi_data(:, 1:end-1) - equi_ub(:, 1:end-1)];

% clear some variables
clear equi_lb equi_ub is_equi_data is_equi

% AS test statistic and critical value
[Tn, cv] = as10_test_corr(m, g_ar, N_mkt, rand_seed, tau_reps, ...
    sig_level, false);













